package com.newsan.service.impl;

import java.sql.*;

import com.alibaba.fastjson.JSON;
import com.newsan.model.User;
import com.newsan.service.NCService;

public class NCServiceImpl implements NCService{
	
	
	/**
	 * 注册功能，建议注册时只有用户名和密码，其它信息后面完善	
	 * @param username
	 * @param password
	 * @return
	 */
	public String CustomerRegistered(String fastJson){
		System.out.println(fastJson);
		User user = JSON.parseObject(fastJson, User.class);
		//这里写入持久化代码
		return "OK";
//		String returnStr = "注册成功：用户名[" + user.getUserName() + "] 密码[" +user.getPassword() +"]";
//		System.out.println(returnStr);	
//		return returnStr;
		
	}

	/**
	 * 根据用户名和密码登陆，成功后返回用户对象
	 * @param username
	 * @param password
	 * @return
	 */
	public User CustomerLogin(String username,String password){
		
		User user = new User();
		user.setUserName("linkyhu");
		user.setAddress("不念过往，不畏将来");
		
		return user;
		
	}

}
